- /* sdmsetsl.cpp by K.Tsuru */
- // function ID = 304 DRADIX only
- /**********************
- SDouble class
- It sets a SLong value.
- **********************/
- #ifndef SN_H
- #include "sn.h"
- #endif
-
- void SDouble::SetSLong(const SLong& m){
- //check the radix
- if(m.Type() != DEC_INT) m.SetError(m.RADIX_ERR, "SL-->SD", 304);
- if( m.Sign(304) == 0 ){ SetZero(); return; }
-
- uint mh1 = m.Head()+1;
- uint sz = mh1 - m.Tail()+1; //+1 for figure[0] = 0
-
- // mh1 < INTDEX_MAX = INT_MAX
- rdxExp = (int)mh1; //exponent
- sz = min(sz, MaxSize());
- valloc(sz, -1); //When sz>MaxSize(), the lower part is neglected.
-
- #ifndef NDEBUG
- m.figure(mh1-1);
- figure(sz-1);
- m.figure(mh1-sz+1);
- #endif
- register uint i;
- fType *v = figure.Elements();
- const fType* mv = m.ReadFigures();
-
- for(i = 1; i < sz ; i++) v[i] = mv[mh1-i];
- v[0] = 0; figure.clear(sz);
-
- aHead = sz-1;
- while(!v[aHead]) aHead--;
-
- aTail = 0;
- while(!v[aTail]) aTail++;
- SetSign(m.Sign(304));
- Reform(304);
- }
sdmsetsl.cpp : last modifiled at 2017/03/17 11:10:45(994 bytes)
created at 2017/10/07 10:21:15
The creation time of this html file is 2017/10/07 10:30:03 (Sat Oct 07 10:30:03 2017).